package Bai07;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;

public class Threading extends Thread{
	Socket con;
	public Threading(Socket c){
		con=c;
		
		start();
	}
	public void run(){
		InputStream is;
		FileOutputStream fo;
		byte[] buff=new byte[32000];
		try {
			while(true){
			is=con.getInputStream();
			int i=is.available();
			if(i==0)
				//continue;
			System.out.println(i);
			is.read(buff, 0, i);
			fo=new FileOutputStream("logout.java");
			fo.write(buff, 0, i);
			break;
			}
			is.close();
			fo.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} 
	}

}
